package com.hkrt.demo.demo1.congroller;

import com.hkrt.demo.demo1.entity.User;
import com.hkrt.demo.demo1.service.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by admin on 2019/12/4.
 */
@RestController
public class Controller {

    private Service service = new Service();

    @RequestMapping("/insert")
    public String insert(User user){
        String insert = service.insert(user);
        return insert;
    }

    @RequestMapping("/delete")
    public String delete(User user){
        String delect = service.delect(user);
        return delect;
    }

    @RequestMapping("/update")
    public String update(User user){
        String update = service.update(user);
        return update;
    }

    @RequestMapping("/select")
    public void select(){
        User user = new User();
        user.setUserid(1);
        user = service.query(user);

    }
}
